\(\int \frac {A+B x}{(a+b x) (d+e x)} \, dx\) [1117]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 20, antiderivative size = 57 \[ \int \frac {A+B x}{(a+b x) (d+e x)} \, dx=\frac {(A b-a B) \log (a+b x)}{b (b d-a e)}+\frac {(B d-A e) \log (d+e x)}{e (b d-a e)} \]

[Out]

(A*b-B*a)*ln(b*x+a)/b/(-a*e+b*d)+(-A*e+B*d)*ln(e*x+d)/e/(-a*e+b*d)

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.050, Rules used = {78} \[ \int \frac {A+B x}{(a+b x) (d+e x)} \, dx=\frac {(A b-a B) \log (a+b x)}{b (b d-a e)}+\frac {(B d-A e) \log (d+e x)}{e (b d-a e)} \]

[In]

Int[(A + B*x)/((a + b*x)*(d + e*x)),x]

[Out]

((A*b - a*B)*Log[a + b*x])/(b*(b*d - a*e)) + ((B*d - A*e)*Log[d + e*x])/(e*(b*d - a*e))

Rule 78

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {A b-a B}{(b d-a e) (a+b x)}+\frac {B d-A e}{(b d-a e) (d+e x)}\right ) \, dx \\ & = \frac {(A b-a B) \log (a+b x)}{b (b d-a e)}+\frac {(B d-A e) \log (d+e x)}{e (b d-a e)} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 50, normalized size of antiderivative = 0.88 \[ \int \frac {A+B x}{(a+b x) (d+e x)} \, dx=\frac {(A b-a B) e \log (a+b x)+b (B d-A e) \log (d+e x)}{b e (b d-a e)} \]

[In]

Integrate[(A + B*x)/((a + b*x)*(d + e*x)),x]

[Out]

((A*b - a*B)*e*Log[a + b*x] + b*(B*d - A*e)*Log[d + e*x])/(b*e*(b*d - a*e))

Maple [A] (verified)

Time = 0.73 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.02

method result size
default \(\frac {\left (-A b +B a \right ) \ln \left (b x +a \right )}{\left (a e -b d \right ) b}+\frac {\left (A e -B d \right ) \ln \left (e x +d \right )}{\left (a e -b d \right ) e}\) \(58\)
norman \(\frac {\left (A e -B d \right ) \ln \left (e x +d \right )}{\left (a e -b d \right ) e}-\frac {\left (A b -B a \right ) \ln \left (b x +a \right )}{\left (a e -b d \right ) b}\) \(59\)
parallelrisch \(-\frac {A \ln \left (b x +a \right ) b e -A \ln \left (e x +d \right ) b e -B \ln \left (b x +a \right ) a e +B \ln \left (e x +d \right ) b d}{\left (a e -b d \right ) b e}\) \(62\)
risch \(\frac {\ln \left (-e x -d \right ) A}{a e -b d}-\frac {\ln \left (-e x -d \right ) B d}{\left (a e -b d \right ) e}-\frac {\ln \left (b x +a \right ) A}{a e -b d}+\frac {\ln \left (b x +a \right ) B a}{\left (a e -b d \right ) b}\) \(90\)

[In]

int((B*x+A)/(b*x+a)/(e*x+d),x,method=_RETURNVERBOSE)

[Out]

(-A*b+B*a)/(a*e-b*d)/b*ln(b*x+a)+(A*e-B*d)/(a*e-b*d)/e*ln(e*x+d)

Fricas [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 53, normalized size of antiderivative = 0.93 \[ \int \frac {A+B x}{(a+b x) (d+e x)} \, dx=-\frac {{\left (B a - A b\right )} e \log \left (b x + a\right ) - {\left (B b d - A b e\right )} \log \left (e x + d\right )}{b^{2} d e - a b e^{2}} \]

[In]

integrate((B*x+A)/(b*x+a)/(e*x+d),x, algorithm="fricas")

[Out]

-((B*a - A*b)*e*log(b*x + a) - (B*b*d - A*b*e)*log(e*x + d))/(b^2*d*e - a*b*e^2)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 226 vs. \(2 (42) = 84\).

Time = 0.90 (sec) , antiderivative size = 226, normalized size of antiderivative = 3.96 \[ \int \frac {A+B x}{(a+b x) (d+e x)} \, dx=- \frac {\left (- A e + B d\right ) \log {\left (x + \frac {- A a e - A b d + 2 B a d - \frac {a^{2} e \left (- A e + B d\right )}{a e - b d} + \frac {2 a b d \left (- A e + B d\right )}{a e - b d} - \frac {b^{2} d^{2} \left (- A e + B d\right )}{e \left (a e - b d\right )}}{- 2 A b e + B a e + B b d} \right )}}{e \left (a e - b d\right )} + \frac {\left (- A b + B a\right ) \log {\left (x + \frac {- A a e - A b d + 2 B a d + \frac {a^{2} e^{2} \left (- A b + B a\right )}{b \left (a e - b d\right )} - \frac {2 a d e \left (- A b + B a\right )}{a e - b d} + \frac {b d^{2} \left (- A b + B a\right )}{a e - b d}}{- 2 A b e + B a e + B b d} \right )}}{b \left (a e - b d\right )} \]

[In]

integrate((B*x+A)/(b*x+a)/(e*x+d),x)

[Out]

-(-A*e + B*d)*log(x + (-A*a*e - A*b*d + 2*B*a*d - a**2*e*(-A*e + B*d)/(a*e - b*d) + 2*a*b*d*(-A*e + B*d)/(a*e
- b*d) - b**2*d**2*(-A*e + B*d)/(e*(a*e - b*d)))/(-2*A*b*e + B*a*e + B*b*d))/(e*(a*e - b*d)) + (-A*b + B*a)*lo
g(x + (-A*a*e - A*b*d + 2*B*a*d + a**2*e**2*(-A*b + B*a)/(b*(a*e - b*d)) - 2*a*d*e*(-A*b + B*a)/(a*e - b*d) +
b*d**2*(-A*b + B*a)/(a*e - b*d))/(-2*A*b*e + B*a*e + B*b*d))/(b*(a*e - b*d))

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.02 \[ \int \frac {A+B x}{(a+b x) (d+e x)} \, dx=-\frac {{\left (B a - A b\right )} \log \left (b x + a\right )}{b^{2} d - a b e} + \frac {{\left (B d - A e\right )} \log \left (e x + d\right )}{b d e - a e^{2}} \]

[In]

integrate((B*x+A)/(b*x+a)/(e*x+d),x, algorithm="maxima")

[Out]

-(B*a - A*b)*log(b*x + a)/(b^2*d - a*b*e) + (B*d - A*e)*log(e*x + d)/(b*d*e - a*e^2)

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 60, normalized size of antiderivative = 1.05 \[ \int \frac {A+B x}{(a+b x) (d+e x)} \, dx=-\frac {{\left (B a - A b\right )} \log \left ({\left | b x + a \right |}\right )}{b^{2} d - a b e} + \frac {{\left (B d - A e\right )} \log \left ({\left | e x + d \right |}\right )}{b d e - a e^{2}} \]

[In]

integrate((B*x+A)/(b*x+a)/(e*x+d),x, algorithm="giac")

[Out]

-(B*a - A*b)*log(abs(b*x + a))/(b^2*d - a*b*e) + (B*d - A*e)*log(abs(e*x + d))/(b*d*e - a*e^2)

Mupad [B] (verification not implemented)

Time = 1.58 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.00 \[ \int \frac {A+B x}{(a+b x) (d+e x)} \, dx=\frac {\ln \left (d+e\,x\right )\,\left (A\,e-B\,d\right )}{a\,e^2-b\,d\,e}+\frac {\ln \left (a+b\,x\right )\,\left (A\,b-B\,a\right )}{b^2\,d-a\,b\,e} \]

[In]

int((A + B*x)/((a + b*x)*(d + e*x)),x)

[Out]

(log(d + e*x)*(A*e - B*d))/(a*e^2 - b*d*e) + (log(a + b*x)*(A*b - B*a))/(b^2*d - a*b*e)